xen/arm: setup: nr_banks should be unsigned int
authorJulien Grall <jgrall@amazon.com>
Tue, 24 May 2022 23:38:15 +0000 (16:38 -0700)
committerStefano Stabellini <stefano.stabellini@xilinx.com>
Tue, 24 May 2022 23:40:19 +0000 (16:40 -0700)
commit49399b101e38fb2c11478c849ffdaaace8e318a8
treebfa459bc8cb62e059abd073bc695dfe5aa46dd89
parentec53e0c4ea94c4442fe31e91170df4cca9f49fbe
xen/arm: setup: nr_banks should be unsigned int

It is not possible to have a negative number of banks. So switch to
unsigned int.

The type change is also propagated to any users of nr_banks that were
using "int" (there are not that many).

Note that fdt_num_mem_rsv() can actually returns a negative value in
case of an error. So the return should be checked before assigning the
result to an unsigned variable.

Signed-off-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Wei Chen <Wei.Chen@arm.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/domain_build.c
xen/arch/arm/efi/efi-dom0.c
xen/arch/arm/include/asm/setup.h
xen/arch/arm/setup.c